package com.cedric.yixianpai.game.cards.Sects.swordCards.a_LianQi;

import com.cedric.yixianpai.game.Constants.Period;
import com.cedric.yixianpai.game.Status.DuelStatus;
import com.cedric.yixianpai.game.interfaces.SwordCard;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class QingJian extends SwordCard {
    public QingJian(@Value("1") int lvl) {
        super("轻剑");
        this.setLevel(lvl);
        this.setPeriod(Period.LIANQI);
        this.setDescription("4攻，灵气+1/2/3");

        this.setDamage(4);
        if (1 == lvl) {
            this.setSpiritAdd(1);
        } else if (2 == lvl) {
            this.setSpiritAdd(2);
        } else if (3 == lvl) {
            this.setSpiritAdd(3);
        } else {
            throw new RuntimeException("错误的卡牌等级！");
        }
    }

    @Override
    public boolean effect(DuelStatus Sta1, DuelStatus Sta2) {
        Sta1.attack(Sta2,this.getDamage());
        Sta1.getPlayerBuff().addSpiritualEnergy(this.getSpiritAdd());
        Sta1.getPlayerBuff().setSwordIntent(0);
        return true;
    }
}
